package com.yoyo.ad.bean;

public class AdConfigList implements Comparable<AdConfigList> {
    private Long adId;
    private String adCode;
    private int adSourceId;
    private int sort;

    public AdConfigList(int adSourceId, Long adId, String adCode) {
        this.adId = adId;
        this.adCode = adCode;
        this.adSourceId = adSourceId;
    }

    public AdConfigList(int adSourceId, Long adId, String adCode, int sort) {
        this.adId = adId;
        this.adCode = adCode;
        this.adSourceId = adSourceId;
        this.sort = sort;
    }

    public Long getAdId() {
        return adId;
    }

    public void setAdId(Long adId) {
        this.adId = adId;
    }

    public String getAdCode() {
        return adCode;
    }

    public void setAdCode(String adCode) {
        this.adCode = adCode;
    }

    public int getAdSourceId() {
        return adSourceId;
    }

    public void setAdSourceId(int adSourceId) {
        this.adSourceId = adSourceId;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    @Override
    public int compareTo(AdConfigList adConfigList) {
        //重写Comparable接口的compareTo方法，根据sort降序排列，升序修改相减顺序即可
        return adConfigList.getSort() - this.sort;
    }
}
